<project name="MadHelix" basedir="." default="jar">
    <property name="srcdir" location="src" />
    <property name="resdir" location="res" />
    <property name="targetdir" location="bin" />
    <property name="jarfile" location="MadHelix.jar" />
    
    <target name="clean">
        <delete dir="${targetdir}" />
        <delete file="${jarfile}" />
    </target>
    
    <target name="compile">
        <mkdir dir="${targetdir}" />
        <javac srcdir="${srcdir}" destdir="${targetdir}" classpath="lib/SoundHelix.jar:lib/gnu-getopt.jar" />
        <copy todir="${targetdir}">
            <fileset dir="res" />
        </copy>
    </target>
    
    <target name="jar" depends="compile">
        <jar basedir="${targetdir}" destfile="${jarfile}">
            <manifest>
                <attribute name="Main-Class"
                    value="org.ultrasonicmadness.madhelix.MadHelix" />
                <attribute name="Class-Path"
                    value=". lib/SoundHelix.jar lib/gnu-getopt.jar lib/log4j.jar" />
            </manifest>
        </jar>
    </target>
</project>
